﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UBlockly.Scriptable;
using Object = UnityEngine.Object;

namespace UBlockly.Compotent
{
    public struct ParamSetterData
    {
        public IVarObject typeValue;
        public string displayValue;

        public ParamSetterData(IVarObject value, string display)
        {
            typeValue = value;
            displayValue = display;
        }
    }
    
    public abstract class IParamSetterPanel : MonoBehaviour
    {
        public abstract Type ParamType { get; }
        internal Action<ParamSetterData> ParamSetter { get; set; }

        protected void OnParamSelect(ParamSetterData data)
        {
            ParamSetter?.Invoke(data);
        }

        public virtual void Open()
        {
            gameObject.SetActive(true);
        }

        public virtual void Close()
        {
            gameObject.SetActive(false);
        }
    }
}

